package com.czl.module_work.fragment

import com.alibaba.android.arouter.facade.annotation.Route
import com.czl.base.base.BaseFragment
import com.czl.base.config.AppConstants
import com.czl.module_work.BR
import com.czl.module_work.R
import com.czl.module_work.databinding.WorkFragmentMyInviteBinding
import com.czl.module_work.view.SharePop
import com.czl.module_work.viewModel.MyInviteViewModel
import com.lxj.xpopup.XPopup

@Route(path = AppConstants.Router.Work.F_WORK_MY_INVITE)
class MyInviteFragment: BaseFragment<WorkFragmentMyInviteBinding, MyInviteViewModel>() {

    var applyId = ""
    override fun useBaseLayout(): Boolean = false;

    override fun initContentView(): Int = R.layout.work_fragment_my_invite

    override fun initVariableId(): Int = BR.viewModel

    override fun initData() {
        viewModel.tvTitle.set("我的预约")
        viewModel.getApplyResult(applyId)
    }

    override fun initParam() {
        applyId = arguments?.getString(AppConstants.BundleKey.WORK_MY_INVITE_ID)?:""
    }
    override fun initViewObservable() {
        viewModel.uc.doTransferFormClick.observe(this, {
            XPopup.Builder(context)
                .asCustom(SharePop(requireContext()))
                .show()
        })
    }
}